/*
	This header file createvfs.h contains the structure definiton of the
	Virtual File System that is created. It also contains the function 
	prototype of the createVFS function.
*/

#define TOTAL_DESC (500)			// total number of file descriptors = 500
#define PATH_SIZE (100)
#define EXT_SIZE (4)
#define LABEL_SIZE (40)

#include "vfs_errorcodes.h"


int createVFS(char [], long int, char[]);
int unmntvfs (char[], char[]);
long int fd_start_pos;			// to find the starting position of the FDs
int freelist[1024];
long int num_blocks;
long int num_used_blocks;
char *filename;

struct Block{
	char blk[1024];					// size of each block is defined as 1 KB = 1024
};


struct FD{
	char path[PATH_SIZE];	
	char name[20];
	int fdnum;						// file descriptor number
	char type[EXT_SIZE];
	unsigned long int size;	
	int blockno;
};


struct header{
	char fs_label[LABEL_SIZE];		// file system label
	int total_desc; 				// total number of file descriptors = 500
	int used_desc;					// number of file descriptors in use
	struct FD fd_arr[TOTAL_DESC];	
};
